import request from '@/utils/request'

// 查询题库列表
export function listQuestionBank(query) {
  return request({
    url: '/exam/questionBank/list',
    method: 'get',
    params: query
  })
}

// 查询题库所有列表
export function listAllQuestionBank(query) {
  return request({
    url: '/exam/questionBank/listAll',
    method: 'get',
    params: query
  })
}

// 查询题库详细
export function getQuestionBank(bankId) {
  return request({
    url: '/exam/questionBank/getInfo/' + bankId,
    method: 'get'
  })
}

// 新增题库
export function addQuestionBank(data) {
  return request({
    url: '/exam/questionBank/add',
    method: 'post',
    data: data
  })
}

// 修改题库
export function updateQuestionBank(data) {
  return request({
    url: '/exam/questionBank/edit',
    method: 'post',
    data: data
  })
}

// 删除题库
export function delQuestionBank(bankId) {
  return request({
    url: '/exam/questionBank/remove/' + bankId,
    method: 'get'
  })
}

// 查询我的题库分类列表
export function myCategoryList(query) {
  return request({
    url: '/exam/questionBank/myCategoryList',
    method: 'get',
    params: query
  })
}

// 查询我的题库列表
export function myQuestionBankList() {
  return request({
    url: '/exam/questionBank/myQuestionBankList',
    method: 'get'
  })
}

// 查询题库进度信息
export function getBankProgressInfo(bankId) {
  return request({
    url: '/exam/questionBank/getBankProgressInfo/' + bankId,
    method: 'get'
  })
}

// 查询本周答题打卡情况
export function getWeeklyCheckIn() {
  return request({
    url: '/exam/questionBank/getWeeklyCheckIn',
    method: 'get'
  })
}